<!doctype html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<html>
<head>
<meta charset="utf-8">
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<link rel="stylesheet" type="text/css" href="${basePath }commonCss/css/global.css">
<link rel="stylesheet" type="text/css" href="${basePath }commonCss/css/layout.css">
<link rel="stylesheet" type="text/css" href="${basePath }commonCss/css/easyui.css">
<script src="${basePath }commonJs/jquery.min.js"></script>
<script src="${basePath }commonJs/jquery.easyui.min.js"></script>
<script src="${basePath }commonJs/jt_normal.js"></script>
<script src="${basePath }commonJs/jt_select.js"></script>
<script src="${basePath }commonJs/tags/My97DatePicker/WdatePicker.js"></script>

<script src="${basePath }commonJs/promotion/wolf_common.js"></script>
<script src="${basePath }commonJs/promotion/wolf_validation.js"></script>
<title>房间管理</title>
</head>
<script type="text/javascript">
$(document).ready(function(){
	
});
function searcheHis(){
	var form = $("#sms_home_form"); 
    var pagebean = new PageBean(form);
    pagebean.setTableId("table_batch");
    pagebean.setCallback(searcheHisCall);
    pagebean.setFootId("page_batch");
    setPagebeanObj(pagebean); 
    pagebean.doPage();
}
function searcheHisCall(data){
	if(wolf.isNotNull(data)){
		wolf.data_foreach(data, function(i,obj){
			var smsId = obj.pkSmsId;//短信ID
			var sendR = obj.sendResult;
			var opt = "<input type=\"button\" class=\"btn_l\" value=\"重新发送\" onClick='alert(\"等待接口开发！\");'>";
			var tr = "<tr>"+
		            	"<td>"+obj.branName+"</td>"+
		                "<td>-</td>"+
		                "<td>"+obj.pkBatchId+"</td>"+
		                "<td>"+obj.sendTime+"</td>"+
		                "<td>"+obj.context+"</td>"+
		                "<td>"+obj.destPhone+"</td>"+
		                "<td>"+( sendR == 1?"发送成功":sendR == 2?"发送失败":"未发送")+"</td>"+
		                "<td>_opt_</td>"+
		            "</tr>";
		     if(wolf.isNotNull(sendR) && sendR == 2){
		    	 tr = tr.replace("_opt_",opt);
		     }else{
		    	 tr = tr.replace("_opt_","");
		     }
		    $("#table_batch").append(tr);
		});
	}
}
</script>
<body class="bg">
<div class="content m_auto">
	<div class="content_l mt10">
    	<ul>
            <shiro:hasPermission name="sms/batch/home.shtml">
            	<li class="content_hover"><a href="${basePath}sms/batch/home.shtml"><i class="nav_icon_v"></i><br>短信发送</a></li>
        	</shiro:hasPermission>
        </ul>
    </div>
    <div class="content_r mt10">
    	<!---- 内容 --->
    	<form action="${basePath }sms/batch/searcheBatchHis.shtml" id="form_batch_his">
        <div class="file_single_dl fixed p20">
        	<dl class="dl_h24">
            	<dd><label>所属门店：</label>
                	<div class="uboxstyle">
                        <select name="fkBranId" id="fkBranId">
                        		<c:forEach items="${branAll }" var="bran" varStatus="cc">
	                            	<c:choose>
		                            	<c:when test="${branId == 'ZB' && cc.index == 0}">
		                            		<option value="${bran.pkBranId}">${bran.branName }</option>
		                            	</c:when>
		                            	<c:when test="${branId != 'ZB' && branId == bran.pkBranId}">
		                            		<option value="${bran.pkBranId}">${bran.branName }</option>
		                            	</c:when>
		                            	<c:when test="${branId == 'ZB'}">
		                            		<option value="${bran.pkBranId}">${bran.branName }</option>
		                            	</c:when>
	                            	</c:choose>
	                            </c:forEach>
	                        </select>
                    </div>
                </dd>
                <dd><label>批次发送：</label>
                	<div class="uboxstyle">
                        <select name="language_c" id="language_c">
                            <option value="">全部</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </dd>
                <dd><label>批次编号：</label><input type="text" class="iput_t w200" name="pkBatchId"></dd>
                <dd><label>发送时间：</label>
                	<input title="" type="text"  id="date1" name="startDate"
					onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,isShowClear:true,readOnly:true,maxDate:'#F{$dp.$D(\'date2\')}'})"
					class="Wdate iput_t w82" readonly />
                    
                	<input title="" type="text"  id="date2" name="endDate"
					onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,isShowClear:true,readOnly:true,minDate:'#F{$dp.$D(\'date1\')}'})"
					class="Wdate iput_t w82" readonly />
                </dd>
                <dd><label>内容：</label><input type="text" class="iput_t w200" name="context"></dd>
                <dd><label>发送结果：</label>
                	<div class="uboxstyle">
                        <select name="sendResult" id="sendResult">
                            <option value="">全部</option>
                            <option value="0">未发送</option>
                            <option value="1">发送成功</option>
                            <option value="2">发送失败</option>
                        </select>
                    </div>
                </dd>
                <dd class="fr"><input type="button" class="btn fr" value="查询"></dd>
            </dl>
        </div>
         <input type="hidden" name="pageNo" value="1">
	      <input type="hidden" name="pageSize" value="15">
        </form>
        <div class="m10">
        <table class="table" id="table_batch">
        	<tr>
            	<th>所属门店</th>
                <th>批次发送</th>
                <th>批次编号</th>
                <th>发送时间</th>
                <th>内容</th>
                <th>号码</th>
                <th>发送结果</th>
                <th>操作</th>
            </tr>
            
           <!--  <tr>
            	<td>无锡</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>发送成功</td>
                <td></td>
            </tr> -->
        </table>
        <!----翻页----->
        <div class="page fr m10" id="page_batch">
        </div>
        <!----翻页----->
        </div>
        <!---- 内容 --->
        
        <div class="clear"></div>
        
        <!----底部按钮----->
        <div class="btm_btn mt10">
                <dl>
                    <dd><input type="button" class="btn" value="返回" onClick="javascript:window.location.href='${basePath}sms/batch/home.shtml'"></dd>
                </dl>
        </div>
        <!----底部按钮----->
        
    </div>
</div>



</body>
</html>

